package com.kkyy.mymusic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kkyy.mymusic.dao.MyMusicDao;
import com.kkyy.mymusic.entity.MyMusicEntity;
import com.kkyy.mymusic.service.MyMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyMusicServiceImpl extends ServiceImpl<MyMusicDao, MyMusicEntity> implements MyMusicService {
    @Autowired
    MyMusicDao myMusicDao;

    @Override
    public void insertOne(MyMusicEntity myMusicEntity) {
        myMusicDao.insertOne(myMusicEntity);
    }

    @Override
    public List<MyMusicEntity> myCollection(Integer userId) {
        return myMusicDao.myCollection(userId);
    }

    @Override
    public void usersdelete(Integer id) {
        // 删除前台用户
        baseMapper.delete(id);
    }

    @Override
    public List<MyMusicEntity> songsbytype(Integer type, Integer id) {
        return baseMapper.songsbytype(type, id);
    }

    // 收藏删除
    @Override
    public void mymusicdel(Integer id) {
        baseMapper.mymusicdelById(id);
    }
}